<template>
	<view>
		<uni-nav-bar :fixed="true" left-icon="back" title="我的足迹" @clickLeft="leftBack" background-color="#318cff" color="#fff"></uni-nav-bar>
		<view>
			<block v-for="(item,index) in list">
				<navigator :url="`/pages/home/details?pId=${item.pId}`" class="dfj-flex dfj-flex-ai-c dfj-bg-white dfj-mg-t-20 dfj-pd-20">
					<view class="dfj-flex-1 dfj-flex dfj-flex-ai-c">
						<view><image class="dfj-bd-radius-20" style="width: 180rpx;height: auto;vertical-align: top;" mode="widthFix" :src="item.iconUrl"></image></view>
						<view class="dfj-mg-l-25">
							<view class="dfj-t-666 dfj-f-28">{{ item.productTitle }}</view>
							<view class="dfj-f-35 dfj-t-danger dfj-mg-t-25">￥{{ item.productPrice }}</view>
						</view>
					</view>
				</navigator>
			</block>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page: 1,
				list: []
			}
		},
		onLoad() {
			this.getList();
		},
		methods: {
			leftBack() {
				uni.navigateBack();
			},
			getList(){
				this.$http({
					url: '/userOpt/getBrowseRecords',
					data: {
						page: this.page,
						row: 15
					}
				}).then(res=>{
					if(res.data.list.length>0){
						this.page++;
						this.list.push(...res.data.list)
					}
				})
			},
		},
		onReachBottom() {
			this.getList()
		}
	}
</script>

<style lang="scss" scoped>
</style>
